// i.d(t, { b: () => SphereVolume })
import * as THREE from "three"
import PureObservable from "../observer/pure.observer"

export default class SphereVolume extends PureObservable {
  origin: THREE.Vector3
  radius: number
  constructor() {
    super()
    this.origin = new THREE.Vector3()
    this.radius = 1 / 0
  }
  updateRadius(e) {
    this.radius = e
  }
  updateOrigin(e) {
    this.origin.copy(e)
  }
  containsPoint(e) {
    return this.origin.distanceToSquared(e) <= this.radius ** 2
  }
}
